home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
utility
/
maken103.zip
/
MAKENAME.DOC
< prev
next >
Wrap
Text File
|
1996-09-11
|
13KB
|
303 lines
==============================================================================
==============================================================================
======================== =======================
======================== MAKENAME =======================
======================== =======================
==============================================================================
==============================================================================
MakeName is Copyright (C) 1992, 1996 by Pinnacle Software
Voice line: +1-514-345-9578
Free Files BBS: +1-514-345-8654 (2400 bps minimum)
CompuServe: 70154,1577
Internet: pinnacl@cam.org
Web: http://www.cam.org/~pinnacl
Head Office: CP386, Mount Royal, QC, Canada H3P 3C6
U.S. Office: Box 714, Airport Road, Swanton, VT 05488
Original concept: James Ludwick
Design and coding: Timothy Campbell
Documentation: Natasha Mirage
Distribution: Kevin Beck
Support services: L.Wilson, Z.Krome
==============================================================================
OVERVIEW
==============================================================================
MakeName writes a batch file (named SETNAME.BAT) that uses the DOS SET command
to set a DOS environment variable to an 8-character string which represents
the current date and time. This can then be CALLed by a batch file that needs
such a string for some purpose (usually as part of a file name).
==============================================================================
WHY YOU NEED MAKENAME -- AN EXAMPLE
==============================================================================
Sometimes you want to create a batch file that you will run once in a while,
which will create a data file, but since each file it creates is essentially
another version of the same data, you want to keep it in the same directory as
earlier copies.
The usual way is to code the batch file is like this:
BATCH FILE "NEWDATA.BAT" EXPLANATION
------------------------------------------- ----------------------------------
@ECHO OFF Turn off command echoing
MAKEDATA Run a program to make the file
RENAME DATA %1 Rename the data file
You would then call up this batch file as in this example:
NEWDATA FILE0001.DAT
In other words, you are using the variable %1 to represent a unique file name.
The problem with this approach is that you have to keep track of the various
files in the directory. It would be nice to have a program that would create
a unique file name based on the date and time.
That's precisely what MAKENAME does!
==============================================================================
INSTALLATION
==============================================================================
The MakeName program (MAKENAME.EXE) should be placed in your DOS PATH. For an
explanation of the DOS PATH command, consult your DOS manual.
==============================================================================
FILES
==============================================================================
The MakeName package comprises the following files:
ROOTNAME EXT FILE PURPOSE DESCRIPTION
-------- --- ------------- -------------------------------------------------
READ ME Documentation Directs your attention to MAKENAME.DOC
MAKENAME DOC Documentation How to use the MakeName utility (this file)
VENDOR DOC Documentation Terms for sharing this software with other people
FILE_ID DIZ Documentation (File used by some BBS's) Brief description
DESC SDI Documentation (File used by some BBS's) Brief description
MAKENAME EXE Program The MakeName utility
EXAMPLE1 BAT Batch file Sample usage of MakeName
EXAMPLE2 BAT Batch file Sample usage of MakeName
ORDER FRM Form/Envelope The order form, to register the MakeName utility
==============================================================================
THE FORMAT OF THE VARIABLE
==============================================================================
The MAKENAME program writes a short batch file (named SETNAME.BAT) that uses
the DOS SET command to set a variable according to the date and time. You can
then use this in your batch file, after CALLing it.
The variable is eight characters long. It uses this format:
Format: YMDHHMMS
Examples: 5230405K (Created 1995/02/03, a little after 04:05)
6NP1631P (Created 1996/11/23 [November 23 '96] just after 4:31 PM)
Key: Y ------- Year The last digit (0 to 9); example: 1993 is 3
M ------- Month The month number (1 to 9) or OND (Oct, Nov, Dec)
D ------- Day The day of the month (1 to 9, A to W)
HH ------ Hour Hour of the day; example: 6 PM is 18
MM ------ Minute Minute of the hour
S ------- Second Second (0 to 9, A to V)
The Second value changes every two seconds, rather than every second. The
letters used for Day and Second never include I or O, as these could be
confused with the digits 1 or 0.
For additional examples, you can run the sample batch file EXAMPLE1.BAT, which
generates a series of variables. This batch file is described in the section
entitled "Sample Batch Files".
==============================================================================
USING THE MAKENAME COMMAND
==============================================================================
COMMAND FORMAT
==============
The format of the MAKENAME command is:
MAKENAME varname [time?]
The "varname" parameter is required (not optional). The "time?" parameter is
optional. If both parameters are omitted, the program displays a screen that
summarizes how it is used.
The parameters are as follows:
varname This is the name of the DOS enviroment variable to be SET by the
batch file SETNAME.BAT.
time? (Optional) Set this parameter to N if you don't want the time part
of the variable set. In such case, the variable will be only three
characters long and represent the year, month and day only.
DUPLICATION
===========
Two names created two seconds or less apart will be the same.
Two names created precisely ten years apart will be the same.
EXAMPLES
========
Here are some examples of the MakeName command:
MAKENAME MYVAR
This would write a batch file named SETNAME.BAT, which would SET the variable
named MYVAR to a string representing the date and time. After CALLing the
SETNAME batch file, the variable %MYVAR% could be used in other batch files.
MAKENAME MYFILE N
This would write a batch file named SETNAME.BAT, which would SET the variable
named MYFILE to a string representing the date only. After CALLing the SETNAME
batch file, the variable %MYFILE% could be used in other batch files.
ERRORLEVELS
===========
The success or failure of the MakeName command can be tested within a batch
file by using IF ERRORLEVEL, as follows:
ERRORLEVEL MEANING
---------- -------
0 MakeName worked successfully
255 An error occured
==============================================================================
SAMPLE BATCH FILES
==============================================================================
This section contains two sample batch files. Copies of these batch files are
included in the MAKENAME package, as EXAMPLE1.BAT and EXAMPLE2.BAT.
Here is a sample batch file that demonstrates the use of MAKENAME:
BATCH FILE "EXAMPLE1.BAT" EXPLANATION
------------------------------------------- ----------------------------------
@ECHO OFF Turn off command echoing
:AGAIN Batch file label
MAKENAME XYZ Make the SETNAME.BAT file
CALL SETNAME.BAT Call it up
ECHO Variable XYZ is set to %XYZ% Demonstrate
ECHO Press Ctrl-C to quit Tell user how to escape loop
PAUSE Wait for a key
GOTO AGAIN Loop back
Here is a sample batch file that backs up your current directory to diskette.
BATCH FILE "EXAMPLE2.BAT" EXPLANATION
------------------------------------------- ----------------------------------
@ECHO OFF Turn off command echoing
MAKENAME MYVAR Make the SETNAME.BAT file
CALL SETNAME.BAT Call it up
PKZIP -a %MYVAR%.ZIP *.* Save everything in a ZIP file (*)
COPY %MYVAR%.ZIP A: Copy the ZIP file to the diskette
DEL %MYVAR%.ZIP Erase ZIP file
DIR A: Show what's on A:
(*) PKZIP is an excellent file compression program created by PKWare Inc.
(PKWARE, Inc. 7545 N. Port Washington Rd,. Glendale, Wisconsin 53217 USA.)
An alternative is the freeware program LHA.
==============================================================================
LICENSING
==============================================================================
This product is available in several forms. For billing and pricing
information, view or print the file ORDER.FRM.
TRIAL COPY: If you have a "test-drive" evaluation copy, you will see a
"Registration Reminder Screen" when you start up the program. You are
entitled to evaluate this program at no cost for 3 months. If you continue to
use it after that, you must register your copy and purchase a license, as
described below.
SINGLE-USER LICENSE: When you register an evaluation copy of this product,
you will receive the latest version, plus an unlocking code that will let you
register any new evaluation versions that we release for a period of two years
(six years for deluxe registration).
SITE/MULTI-COPY LICENSES: If you plan to run 15 or more copies of this
program (on a network or on separate computers), you can obtain quantity
pricing. For details, view or print the text file ORDER.FRM.
LAN LICENSE: Local Area Network users must purchase a license for each user
(see "Single-User License" and "Site/Multi-Copy Licenses"), although they can
reduce this amount if they have run-control software which sets an upper limit
on the number of concurrent users for a given program.
WAN LICENSE: Wide Area Networks are treated like LANs, but you may find it
more economical to purchase a Distribution License (see below).
DISTRIBUTION LICENSE: The distribution license allows you to use an unlimited
number of copies. You may include it in your application or commercial
package as a utility. The only restriction is that you may not distribute
this document (i.e. the user manual) or its essential content. With this
safeguard, we avoid placing ourselves in competition with you; the program
must be used to support an application or product rather than being its main
feature.
SOURCE CODE LICENSE: If you purchase the Turbo Pascal source code, you must
also purchase a license for each machine that will run the modified program.
Those portions of the source code written by Pinnacle Software remain
copyrighted by Pinnacle, and may not be divulged to another party. As an
alternative to purchasing the source code, you can also contract for us to
make custom modifications to the program.
RETAIL LICENSE: You can sell complete, registered copies of this product,
complete with documentation, in return for royalties. The terms depend on
volume and advance payments. Contact us for details.